package com.hujiheng.paike.mapper;

import com.hujiheng.paike.pojo.Teacher;
import com.hujiheng.paike.view.TeacherView;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("teacherMapper")
public interface TeacherMapper {
    //根据ID查询
    Teacher getById(@Param("teacherId") int teacherId);
    //根据名称查询教师列表
    List<Teacher> getTeachersByName(@Param("teacherName") String teacherName);
    //根据名称关键字查询教师列表
    List<Teacher> getTeachersLikeName(@Param("teacherName") String teacherName);
    //根据课程ID查询教授的教师
    List<Teacher> getTeachersByCourseId(@Param("courseId") int courseId);
    //添加教师信息
    int addTeacher(@Param("teacher") Teacher teacher);
    //更新教师信息
    int updateTeacher(@Param("teacher") Teacher teacher);
    //根据教师Id删除教师信息
    int deleteTeacher(@Param("teacherId") int teacherId);

    List<TeacherView> getTeacherList();
}
